package com.springcloud.zull.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import utils.ResponseBean;

/**
 * @author wfh
 */
@RestControllerAdvice
@Slf4j
public class ExceptionAvice {

    @ExceptionHandler(Exception.class)
    private ResponseBean packException(Exception e) {
        e.printStackTrace();
        return ResponseBean.fail(e.getMessage());

    }
}
